package code.remote {

import mx.rpc.events.ResultEvent;
	

public class ResultErrorContainer {
	
	private var _errorCode: int;
	
	private var _errorMessage: String;
	
	public function ResultErrorContainer(errorCode: int, errorMessage: String) {
		_errorCode = errorCode;
		_errorMessage = errorMessage;
	}

	public function get errorCode(): int {
		return _errorCode;
	}
	
	public function get errorMessage(): String {
		return _errorMessage;
	}
	
	public static function newByResultEvent(event: ResultEvent): ResultErrorContainer {
		const errorCode: int = int(event.result.Result.ErrorCode);
		const errorMessage: String = String(event.result.Result.ErrorMessage);
		
		return new ResultErrorContainer(errorCode, errorMessage);
	}

}
}